#include "system_tick.h"

#include "bsp_api.h"

#define TICKS_PER_SECOND 1000

volatile TIMING_FORMAT g_tick_count = 0;

void systick_init() { SysTick_Config(SystemCoreClock / TICKS_PER_SECOND); }

void SysTick_Handler(void) { g_tick_count += 1; }

TIMING_FORMAT systick_get() { return g_tick_count; }